<?php
/**
 * 用户圈子列表
 */
namespace App\Services\Member;

use App\Models\Member\Attr;
use App\Models\Member\Member;
use App\Services\Com\UtilService;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;

class Circle
{
    public static function circleMore(){

        $list_res = null;

        $list = Attr::with([
                'file'=>function($query){
                    $query->select(['service_id', 'path']);
                }
            ])
        ->orderBy(\DB::raw('RAND()'))->limit(6)->get();
        
        
        if(!empty($list)){
            $list_arr = $list->toArray(); 

            foreach ($list_arr as $key => $value) {
                $list_res[] = [
                    'name'=>$value['name'],//类型名称
                    'uuid'=>$value['uuid'], //类型uuid
                    'avatar'=>$value['file']['path']//类型配图
                ];
            }
        }
        return $list_res;
    }
}